Brussels | ITP-2025-1 | Preeti Tyagi | Week 6 | Sprint 3 Coursework/sprint-3-practice-tdd#36
Conversation
completed the code using for loop
made changes as required
completed the code
completed the code for different cases
made correction
completed the cases
| @@ -1,5 +1,11 @@ | |||
| function getOrdinalNumber(num) { | |||
| if (num > 1 || num < 1) { | |||
There was a problem hiding this comment.
I have added implementation in the code. The code is now updated @MustafaBora
There was a problem hiding this comment.
I see you have solved the question on get-ordinal-number.test.js.
Test file should contain only the tests, and this file should contain the solution
There was a problem hiding this comment.
tests like:
test("should return '3rd' for 3", () => {
expect(getOrdinalNumber(3)).toEqual("3rd");
});
test("should return '11th' for 11", () => {
expect(getOrdinalNumber(11)).toEqual("11th");
});
test("should return '13th' for 13", () => {
expect(getOrdinalNumber(13)).toEqual("13th");
});
implementation completed.
| @@ -1,11 +1,13 @@ | |||
| function getOrdinalNumber(num) { | |||
| if (num > 1 || num < 1) { | |||
There was a problem hiding this comment.
Everything except 1 will give true here. Check the question again please, you misunderstood the question.
The method takes a number and then should return an ordinal number equvalent of it.
For example:
1 -> 1st
2 -> 2nd
3 -> 3rd
4 -> 4th
Self checklist
Change list
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.